Having another problem in another script with the close() hanging.
Different issue than in my prior post here:
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=363294
Specifically, one dialog (dbMain) has a button that puts up a new dialog (dbNew).
For dbNew, I have two buttons:
ok(dbNew,okCallback) and
close(dbNew,false,closeCallback) (button not visible, but standard Windows "X" icon will invoke)
Both callbacks simply set some flags and nothing more.
The dbMain button callback that puts up this 2nd (dbNew) dialog simply:
blocks on dbNew; then unconditionally releases/hides/destroys dbNew.
Problem is: ok button works to close dbNew and go back to dbMain, but the "X" icon in top right (for close), doesn't do anything. How do I make that "X" functional??
If I change the close() callback to be same function as for ok(), the result is the same ("X" icon doesn't do anything).
If I add a call to hide() in the close callback like the Help suggests, this hangs doors (new dialog goes invisible, other dialog/DOORS items non-functional/non-responsive, if they are even visible).
Thanks,
strathglass.
strathglass - Fri Mar 25 10:40:50 EDT 2011 |
|
Re: close() callback hangs again Mathias Mamsch - Fri Mar 25 12:09:57 EDT 2011
See this post.
-
Always do a release if you do a block. I always do: block dbVar; release dbVar, in callbacks I only do "hide dbVar"
-
Don't call destroy in a callback, call it after the block.
You might want to post your code.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: close() callback hangs again llandale - Fri Mar 25 14:55:04 EDT 2011
This would be a lot easier if you posted the relevant code. But I can infer reasonably well, so here goes: your 2nd dialog is "blocked" and your "close" fails to "release" it.
Your DB main callback that "blocks" dbNew does not "release" it; "release" is how you close the dialog from the new callbacks and get DXL to start executing the statement after the "block". After "block", you should "destroy". However, having an extraneous "release" after "block" doesn't seem to matter.
I wonder if you have two "closeCallback" functions; would it not be easier to understand if you renamed this one to "dbNew_CloseCallback"?
Blocked code should look like this:
void clbkClose(DB dbXX)
{ DoWhatever
release(dbXX)
}
void buttonWhatever(DB dbXX)
{ do whatever
sometimes call clbkClose(dbXX)
}
void CreateDialog()
{
create the dialog
close(db, false or true, clbkClose)
block(db)
destroy(db)
proceed.
}
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:25:32 EDT 2011
Thanks Louie & Mathias... (trying to find out what is causing DISALLOWED CONTENT error, so posting reply in pieces, sorry!!)
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:25:53 EDT 2011 strathglass - Mon Mar 28 07:25:32 EDT 2011
Thanks Louie & Mathias... (trying to find out what is causing DISALLOWED CONTENT error, so posting reply in pieces, sorry!!)
Tried playing around a bit more, and found a solution:
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:26:08 EDT 2011 strathglass - Mon Mar 28 07:25:53 EDT 2011
Tried playing around a bit more, and found a solution:
-as suggested by Louie, if I simply added a release() to the end of the close() callbacks for the 2nd dialog, it works!
-if I added a hide() though, that just froze things.
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:26:44 EDT 2011 strathglass - Mon Mar 28 07:26:08 EDT 2011
-as suggested by Louie, if I simply added a release() to the end of the close() callbacks for the 2nd dialog, it works!
-if I added a hide() though, that just froze things.
What is odd is I have a release() already for the 2nd dialog - right after the block() that displays it: why do I need to additionally add a release() to the actual close() callback?
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:27:19 EDT 2011 strathglass - Mon Mar 28 07:26:44 EDT 2011
What is odd is I have a release() already for the 2nd dialog - right after the block() that displays it: why do I need to additionally add a release() to the actual close() callback?
(It is not needed for the ok() button.)
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:28:56 EDT 2011 strathglass - Mon Mar 28 07:27:19 EDT 2011
(It is not needed for the ok() button.)
And why does the DXL HELP not help?
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:31:42 EDT 2011 strathglass - Mon Mar 28 07:28:56 EDT 2011
And why does the DXL HELP not help?
It says 'the call--back mu--st ex--plicitly hi--de the dia--log b--ox'
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:32:34 EDT 2011 strathglass - Mon Mar 28 07:31:42 EDT 2011
It says 'the call--back mu--st ex--plicitly hi--de the dia--log b--ox'
|
|
Re: close() callback hangs again strathglass - Mon Mar 28 07:33:54 EDT 2011 strathglass - Mon Mar 28 07:31:42 EDT 2011
It says 'the call--back mu--st ex--plicitly hi--de the dia--log b--ox'
(OK, it was the last non-empty comment above causing the DISALLLOWED CONTENT error:
I added the double dashes to avoid the error. What a stupid system IBM has!!!!)
|
|
Re: close() callback hangs again llandale - Mon Mar 28 14:26:08 EDT 2011 strathglass - Mon Mar 28 07:31:42 EDT 2011
It says 'the call--back mu--st ex--plicitly hi--de the dia--log b--ox'
You really should get the DXL Help file with the hidden text included, the incorrect text removed, and the ambiguous text clarified; found here:
DXL Help Annotated by Consensus
In this case the "ex--plic--it hide" sentence applies to "show"n dialogs, not "block"ed ones, which you could see had you not lost your D. Tracy private-eye Infra-Vio--let Spectro-Graphite glasses. <2 Disallowed Contect Detected> in previous sentance.
As for a couple of your other short posts: Execution stops at "block". I think you can reasonably deduce that if you "hide" a blocked dialog without releasing it, that the code after the block will not execute because you did not release it; thus looking like a "hang". You can also reasonably deduce that adding "release" after the "block" doesn't make sense, since it requires a "release" to get to that statement.
The outline I gave above for "block"ing dialogs is a good one and should be deviated only when done so mindfully. Having said that, indeed you could "release" then "dest--roy" the dialog inside the "close" and that would work, since the code after the "block" doesn't actually start executing until after the code with the "release" stops. But that gets mes--sy when you have some huge dialog with lots of call--backs.
As for <Disallowed Contect Detected>, yes its annoying and I get it often. They really should highlight the offen--ding words; but the Web Site administrators are just a bunch of <Disallowed Contect Detected>.
Oh, I just like dry humor! lol :)
|
|